load("//tools/lint:lint.bzl", "add_lint_tests")
load(
    "//tools/performance:defs.bzl",
    "drake_cc_googlebench_binary",
    "drake_py_experiment_binary",
)
load("//tools/skylark:drake_cc.bzl", "drake_cc_binary")
load("//tools/skylark:test_tags.bzl", "vtk_test_tags")

package(default_visibility = ["//visibility:private"])

drake_cc_googlebench_binary(
    name = "iris_in_configuration_space_benchmarks",
    srcs = ["iris_in_configuration_space_benchmarks.cc"],
    add_test_rule = True,
    data = [
        "@drake_models//:iiwa_description",
        "@drake_models//:manipulation_station",
        "@drake_models//:wsg_50_description",
    ],
    test_args = [
        "--test",
    ],
    test_timeout = "moderate",
    deps = [
        "//geometry/optimization:iris",
        "//multibody/inverse_kinematics",
        "//multibody/plant",
        "//tools/performance:fixture_common",
        "//tools/performance:gflags_main",
    ],
)

drake_py_experiment_binary(
    name = "iris_in_configuration_space_experiment",
    googlebench_binary = ":iris_in_configuration_space_benchmarks",
)

drake_cc_googlebench_binary(
    name = "mesh_intersection_benchmark",
    srcs = ["mesh_intersection_benchmark.cc"],
    add_test_rule = True,
    test_timeout = "moderate",
    deps = [
        "//common:essential",
        "//geometry/proximity:make_ellipsoid_field",
        "//geometry/proximity:make_ellipsoid_mesh",
        "//geometry/proximity:make_sphere_mesh",
        "//geometry/proximity:mesh_intersection",
        "//math",
    ],
)

drake_cc_googlebench_binary(
    name = "compliant_mesh_intersection_benchmark",
    srcs = ["compliant_mesh_intersection_benchmark.cc"],
    add_test_rule = True,
    test_timeout = "moderate",
    deps = [
        "//common:essential",
        "//geometry/proximity:hydroelastic_calculator",
        "//geometry/proximity:hydroelastic_internal",
        "//geometry/proximity:make_ellipsoid_field",
        "//geometry/proximity:make_ellipsoid_mesh",
        "//geometry/proximity:make_sphere_field",
        "//geometry/proximity:make_sphere_mesh",
        "//math",
        "//tools/performance:gflags_main",
    ],
)

drake_py_experiment_binary(
    name = "mesh_intersection_experiment",
    googlebench_binary = ":mesh_intersection_benchmark",
)

drake_cc_googlebench_binary(
    name = "render_benchmark",
    srcs = ["render_benchmark.cc"],
    add_test_rule = True,
    test_args = [
        # To save time, only run the low-resolution tests in CI.
        "--benchmark_filter=.*/1/1/320/240",
    ],
    test_display = True,
    test_tags = vtk_test_tags(),
    deps = [
        "//common:add_text_logging_gflags",
        "//geometry/render",
        "//geometry/render_gl",
        "//geometry/render_vtk",
        "//systems/sensors:image_writer",
        "//tools/performance:gflags_main",
        "@fmt",
        "@gflags",
    ],
)

drake_py_experiment_binary(
    name = "render_experiment",
    googlebench_binary = ":render_benchmark",
)

drake_cc_googlebench_binary(
    name = "proximity_defaults_benchmark",
    srcs = ["proximity_defaults_benchmark.cc"],
    add_test_rule = True,
    deps = [
        "//geometry:scene_graph",
        "//tools/performance:gflags_main",
        "@fmt",
    ],
)

drake_py_experiment_binary(
    name = "proximity_defaults_experiment",
    googlebench_binary = ":proximity_defaults_benchmark",
)

drake_cc_googlebench_binary(
    name = "boxes_overlap_benchmark",
    srcs = ["boxes_overlap_benchmark.cc"],
    add_test_rule = True,
    deps = [
        "//geometry/proximity:boxes_overlap",
        "//geometry/test_utilities:boxes_overlap_transforms",
        "//tools/performance:gflags_main",
        "@fmt",
    ],
)

drake_py_experiment_binary(
    name = "boxes_overlap_experiment",
    googlebench_binary = ":boxes_overlap_benchmark",
)

add_lint_tests()
